package com.hyl.crmclient.service;

import com.hyl.jpademo.dao.SysUserRepository;
import com.hyl.jpademo.entity.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Description TODO
 * @Author hyl
 * @Date 2022/5/24 15:17
 **/
@Service("userService")
public class UserServiceImpl implements UserService {

	@Autowired
	private SysUserRepository userRepository;

	@Override
	public String login() {
		return "hyl";
	}

	@Override
	public User login(String username, String pwd) {
		return userRepository.findByUsrNameAndAndUsrPassword(username, pwd);
	}

	@Override
	public List<User> findAll() {
		return userRepository.findAll();
	}

	@Override
	public User findByUsername(String name) {
		return userRepository.findByUsrName(name);
	}


}
